// 封装 uniCloud promise
let $http = (options) => {
	const {
		url,
		data
	} = options
	return new Promise((resolve, reject) => {
		uniCloud.callFunction({
			name: url,
			data
		}).then(res => {
			if (res.result.status === 200) {
				resolve(res.result)
			} else {
				reject(res.result)
			}
		}).catch((err) => {
			reject(err)
		})
	})
}
export { $http }